package com.tonghe.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @Date:2022/7/23- 07- 23- 9:38
 * @author: tonghe
 **/
@Configuration
public class SwaggerConfig {

    @Bean
    public Docket customDocket() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.tonghe.controller"))
                .build();
    }

    private ApiInfo apiInfo() {
        Contact team = new Contact("thisisth", "www.tongh046.com", "2996139769@qq.com");
        return new ApiInfoBuilder()
                .title("")
                .description("")
                .contact(team)
                .version("1.0.0")
                .build();
    }

}
